From: Arto Jantunen <viiru@debian.org>
Date: Sun, 29 Oct 2017 13:34:01 +0200
Subject: Use system qscintilla2

---
 cmake/FindQScintilla.cmake | 2 +-
 src/tests/CMakeLists.txt   | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/cmake/FindQScintilla.cmake b/cmake/FindQScintilla.cmake
index 4d23177..400b408 100644
--- a/cmake/FindQScintilla.cmake
+++ b/cmake/FindQScintilla.cmake
@@ -93,7 +93,7 @@ endif ()
 
 find_library ( QSCINTILLA_LIBRARY
   NAMES qscintilla2 qscintilla2_qt5
-  HINTS /usr/local/lib /usr/local/opt/qscintilla2/lib
+  HINTS ${QT_LIBRARY_DIR}
 )
 
 set ( QSCINTILLA_LIBRARIES ${QSCINTILLA_LIBRARY} )
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index ccf87c6..ff8bccf 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -63,6 +63,9 @@ set(QT_LIBRARIES "")
 
 target_link_libraries(test-sqlobjects ${QT_LIBRARIES} ${LIBSQLITE})
 target_link_libraries(test-sqlobjects ${LPTHREAD})
+link_directories("${CMAKE_CURRENT_BINARY_DIR}/${QSCINTILLA_DIR}")
+add_dependencies(test-sqlobjects qscintilla2_qt5)
+target_link_libraries(test-sqlobjects qscintilla2_qt5)
 add_test(test-sqlobjects test-sqlobjects)
 
 # test-import
@@ -140,6 +143,9 @@ set(QT_LIBRARIES "")
 
 target_link_libraries(test-regex ${QT_LIBRARIES} ${LIBSQLITE})
 target_link_libraries(test-regex ${LPTHREAD})
+link_directories("${CMAKE_CURRENT_BINARY_DIR}/${QSCINTILLA_DIR}")
+add_dependencies(test-regex qscintilla2_qt5)
+target_link_libraries(test-regex qscintilla2_qt5)
 add_test(test-regex test-regex)
 
 # test cache
